
import { request } from '@/utils/request';


import { BaseModel } from '@/api/common/baseModel'

export interface Model extends BaseModel {
  parentId: string
  leaderUserId: string
  phone: string
  email: string
  createTime: Date
}

// 查询部门（精简)列表
export const getList = async (): Promise<Model[]> => {
  return await request.get({ url: '/staff/web/userCenter/oa/dept/page.json?pageSize=0' })
}

// 查询部门列表
export const getPage = async (params: any) => {
  return await request.get({ url: '/staff/web/userCenter/oa/dept/page.json', params })
}

// 查询部门详情
export const getById = async (id: string) => {
  return await request.get({ url: '/staff/web/userCenter/oa/dept/getById.json?id=' + id })
}

// 修改部门
export const update = async (params: any) => {
  return await request.put({ url: '/staff/web/userCenter/oa/dept/update.json', data: params })
}

// 删除部门
export const del = async (id: string) => {
  return await request.delete({ url: '/staff/web/userCenter/oa/dept/del.json?id=' + id, data: [id,], })
}
